package ecom.nopecom;

//import ecom.nopecom.util.NopeLogger;
//import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.rules.Timeout;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import ecom.nopecom.util.NopComFactory;
import ecom.nopecom.util.NopeDriver;

public abstract class BasePage {

//    private static final NopeLogger LOGGER = NopComFactory.getLogger(BasePage.class);



	//protected NopeDriver nopeDriver = (NopeDriver) NopComFactory.getFirefoxBrowser();
    protected WebDriver nopeDriver = NopComFactory.getBrowser();


	public abstract WebElement getLandingElement();

	public void assertThePageIsLoaded()
	{
		Assert.assertTrue(getLandingElement().isDisplayed());
	}
	
	public void assertThePageIsLoadedWithWait()
	{
		WebElement defaultElement = this.getLandingElement();
//		if(nopeDriver.elementExists(defaultElement))
//		{
//			nopeDriver.waitForElement(defaultElement);
//		}
		Assert.assertTrue(getLandingElement().isDisplayed());
	}
}
